<template>
	<!-- <view>
		<myHead title="发布职位" :right="true" :text_right="type == 1 ? '发布' : '修改'" @clickRight="clickRight"></myHead>
		<view class="conten" :key="key">

			<view class="li-box  fl-lr-c" @click="dropDown('WorkType')">
				<view class="name">工作类型</view>
				<view class="fl-t">
					<view class="content">
						{{obj.WorkType !== null ? conversion(obj.WorkType, $store.state.leixing) : '请选择'}}
					</view>
					<u-icon name="arrow-right"></u-icon>
				</view>
			</view>

			<view class="li-box  fl-lr-c">
				<view class="name">公司名称</view>
				<view>
					<input style="width:356rpx; #999999;text-align: end;" maxlength="5" placeholder-class="input_pal"
						type="text" disabled v-model="obj.CorpName" placeholder="请输入" />
				</view>
			</view>

			<view class="li-box  fl-lr-c">
				<view class="name">职位名称</view>
				<view>
					<input placeholder-class="input_pal" style="text-align: end;" type="text" v-model="obj.JobName"
						maxlength="10" :disabled='zhiweidisabled' placeholder="请输入" />
				</view>
			</view>

			<view class="li-box  fl-lr-c">
				<view class="name">招聘人数(人)</view>
				<view>
					<input placeholder-class="input_pal" style="text-align: end;" type="number" value="number"
						v-model="obj.Amount" placeholder="请输入" maxlength="3"/>
				</view>
			</view>

			<view class="li-box  fl-lr-c" @click="dropDown('Experience')">
				<view class="name">工作经验</view>
				<view class="fl-t">
					<view class="content">
						
						{{obj.Experience !== null ? conversion(obj.Experience, $store.state.jingyan) : '请选择'}}
					</view>
					<u-icon name="arrow-right"></u-icon>
				</view>
			</view>

			<view class="li-box  fl-lr-c" @click="dropDown('Education')">
				<view class="name">最高学历</view>
				<view class="fl-t">
					<view class="content">
						{{obj.Education ? conversion(obj.Education, $store.state.xeuli) : '请选择'}}
					</view>
					<u-icon name="arrow-right"></u-icon>
				</view>
			</view>

			
			<view class="li-box  fl-lr-c" @click="gongsiAddressShowClick">
				<view class="name">
					<view>工作地址</view>
					<u-button type="primary" style="margin-left: 20rpx;" @click.native.stop="Addresszidingyi"
						size="mini" plain text="自定义"></u-button>
				</view>
				<view class="fl-t">
					<view class="content">
						{{obj.Address?obj.Address:"请选择"}}
					</view>
					<u-icon name="arrow-right"></u-icon>
				</view>
			</view>
			<u-picker :show="gongsiAddressShow" :columns="gongsiAddress" closeOnClickOverlay
				@cancel="gongsiAddressShow=false" @close="showJobState=false" @confirm='addressOkClick'
				:defaultIndex='defaultIndexAdd'></u-picker>
			<view class="li-box  fl-lr-c" @click="dropDown('JobType')">
				<view class="name">招聘类型</view>
				<view class="fl-t">
					<view class="content">
						{{obj.JobType !== null ? conversion(obj.JobType, $store.state.zhaopinlx) : '请选择'}}
					</view>
					<u-icon name="arrow-right"></u-icon>
				</view>
			</view>

			<view class="li-box  fl-lr-c" @click="type==2 ? $util.toast('不能修改') : $refs.picker.show()">
				<view class="name">职位类别</view>
				<view class="fl-t">
					<view class="content" v-if="this.$store.state.industry">
						{{obj.PositionId ? PositionLab : '请选择'}}
					</view>
					<u-icon name="arrow-right"></u-icon>
				</view>
			</view>
			<uni-data-picker v-if="colum" :localdata="colum" v-model="zwVal" class="unidatapickert"
				popup-title="请选择期望职位" ref="picker" @change="onchange">
			</uni-data-picker>

			<view class="li-box  fl-lr-c" @click="!xzcustomize ? dropDown('Wage') : ''">
				<view class="name">
					<view>薪资待遇</view>
					<u-button type="primary" style="margin-left: 20rpx;"
						@click.native.stop="xzcustomize = !xzcustomize; obj.Wage = null" size="mini" plain text="自定义">
					</u-button>
				</view>
				<view class="fl-t">
					<view class="content">
						{{obj.Wage ? xzda : '请选择'}}
					</view>
					<u-icon name="arrow-right"></u-icon>
				</view>
			</view>
			<view v-if=" xzcustomize" class="customized">
				<view class="lib1">
					<u--input placeholder="最低薪资(k)" border="surround" clearable :disabled="xzShow"
						disabledColor="#F1F2F6" v-model="MinWage" @blur="checkout('min')"></u--input>
					<view class="just">
						—
					</view>
					<u--input placeholder="最高薪资(k)" border="surround" clearable :disabled="xzShow"
						disabledColor="#F1F2F6" v-model="MaxWage" @blur="checkout('max')"></u--input>
				</view>
				<view class="lib2" v-if="!xzShow">
					<u-button type="primary" text="取消"
						@click="xzcustomize = false, xzShow = false, MinWage = null, MaxWage = null,obj.Wage = null"
						plain style="margin-right: 10rpx;"></u-button>
					<u-button type="primary" text="确定" @click="xinziOKClick"
						:disabled="MaxWage == null || MinWage == null || Number(MaxWage) <= Number(MinWage)"></u-button>
				</view>
				<view class="lib3" v-else>
					<u-button type="error" text="删除"
						@click="xzcustomize = false, xzShow = false, MinWage = null, MaxWage = null"></u-button>
				</view>
			</view>
			<u-toast ref="uToast"></u-toast>
			<view class="li-box  fl-lr-c" @click="!sbcustomize ? dropDown('OfficeHours') : ''">
				<view class="name">
					<view>上班时间</view>
					<u-button type="primary" style="margin-left: 20rpx;"
						@click.native.stop="sbcustomize = !sbcustomize; obj.OfficeHours = null" size="mini" plain
						text="自定义"></u-button>
				</view>
				<view class="fl-t">
					<view class="content" style="overflow: hidden;text-overflow:ellipsis;text-align: end;">
						{{!sbcustomize && obj.OfficeHours ? obj.OfficeHours : '请选择'}}

					</view>
					<u-icon name="arrow-right"></u-icon>
				</view>
			</view>
			<view v-if="sbcustomize" class="customized">
				<view class="lib1" style="flex: 1;">
					<u--input id="shangbanshijian" placeholder="如:早上9:00~12:00 下午14:00~18:00 限30字"
						placeholder-class="font-size:10rpx" border="surround" clearable :disabled="sbShow"
						disabledColor="#F1F2F6" maxlength="30" v-model="obj.OfficeHours"></u--input>
				</view>
				<view class="lib2" v-if="!sbShow">
					<u-button type="primary" text="取消"
						@click="sbShow = false, obj.OfficeHours = null, sbcustomize = false" plain
						style="margin-right: 10rpx;width: 100rpx;"></u-button>
					<u-button type="primary" text="确定" @click="sbShow = true" style="width: 100rpx;"
						:disabled="obj.OfficeHours == null">
					</u-button>
				</view>
				<view class="lib3" v-else>
					<u-button type="error" text="删除"
						@click="sbcustomize = false, sbShow = false, obj.OfficeHours = null"></u-button>
				</view>
			</view>

			<view class="li-box  fl-lr-c" @click="!jxcustomize ? dropDown('Holiday') : ''">
				<view class="name">
					<view>工作假期</view>
					<u-button type="primary" style="margin-left: 20rpx;"
						@click.native.stop="jxcustomize = !jxcustomize; obj.Holiday = null" size="mini" plain
						text="自定义"></u-button>
				</view>
				<view class="fl-t">
					<view class="content" style="overflow: hidden;text-overflow:ellipsis;text-align: end;">
						{{!jxcustomize&&obj.Holiday ? obj.Holiday : '请选择'}}
					</view>
					<u-icon name="arrow-right"></u-icon>
				</view>
			</view>
			<view v-if="jxcustomize" class="customized">
				<view class="lib1" style="flex: 1;">
					<u--input placeholder="如:月休4天限30字" border="surround" clearable :disabled="jxShow"
						disabledColor="#F1F2F6" maxlength="30" v-model="obj.Holiday"></u--input>
				</view>
				<view class="lib2" v-if="!jxShow">
					<u-button type="primary" text="取消" @click="jxShow = false, obj.Holiday = null, jxcustomize = false"
						plain style="margin-right: 10rpx;"></u-button>
					<u-button type="primary" text="确定" @click="jxShow = true" :disabled="obj.Holiday == null">
					</u-button>
				</view>
				<view class="lib3" v-else>
					<u-button type="error" text="删除" @click="jxcustomize = false, jxShow = false, obj.Holiday = null">
					</u-button>
				</view>
			</view>
			<view class="li-box  fl-lr-c" @click="popupShow = true">
				<view class="name">
					<view>职位关键词</view>
				</view>
				<view class="fl-t">
					<view class="content">
						{{yixuan ? '已选择（' + yixuan + '）' : '请选择'}}
					</view>
					<u-icon name="arrow-right"></u-icon>
				</view>
			</view>
			<u-popup :show="popupShow" @close="popupShow=false" @open="open">
				<view class="popover">
					<view class="popover-ul">
						<view class="popover-li" v-for="(ite, index) in obj.Tags" :key="index" v-if="obj.Tags.length>0">
							<u-tag :text="ite.FullName" :plain="!ite.checked" :name="index"
								@click="checkboxClick(ite,index)" :closable='ite.closable' :show="ite.close1"
								@close="shut(index)"></u-tag>
						</view>
					</view>
					<u-popup :show="addShow" @close="addShow=false" @open="open" mode="center">
						<view class="addClass">
							<view class="addClass-top">
								<view class="top-text">
									添加职位关键字
								</view>
								<view class="top-input">
									<input placeholder="请输入内容" class="inputCla" v-model="word" border="surround"
										maxlength="8"></input>
								</view>
							</view>
							<view class="addClass-bottom">

								<u-button type="primary" text="取消" @click="addShow=false, word=''" plain></u-button>
								<u-button type="primary" text="确定" @click="DynamicAddition">
								</u-button>
							</view>

						</view>
					</u-popup>
					<view class="popover-bottom">
						<view class="bottom-left">
							已选：{{yixuan}}/9
						</view>
						<view class="bottom-right">
							<u-icon name="plus-circle" class="plus-circle" size="25px" @click="addShow=true" v-if="yixuan<9	"></u-icon>
							<u-button type="primary" text="取消" @click="popupShow=false, chooseIndex=[]" plain
								style="margin-right: 30rpx;"></u-button>
							<u-button type="primary" text="确定" @click="popupShow=false">
							</u-button>
						</view>
					</view>
				</view>
			</u-popup>

			<view class="li-box  fl-lr-c">
				<view class="name">
					<view>视频介绍</view>
					<u-icon name="question-circle-fill" size="20" style="margin-left: 20rpx;"
						@click="$util.toast('上传视频，限制300MB')"></u-icon>
				</view>
				<view @click="videoClick"
					style="display: flex;justify-content: center;  align-items: center; flex-wrap: wrap; background-color: #FFF;margin-bottom: 1px;">
					<u-upload :fileList="fileList1" accept="video" @afterRead="uploadAvatar"
						@delete="deletePicuploadAvatar" name="5" :maxCount="1" previewFullImage previewImage
						:maxSize="videomaxsize" @oversize="Videooversize"></u-upload>
				</view>

			</view>

			<view class="li-box  fl-lr-c">
				<view class="name">
					<view>视频封面 </view>
					<u-icon name="question-circle-fill" size="20" style="margin-left: 20rpx;"
						@click="$util.toast('上传图片，限制3MB')"></u-icon>
				</view>
				<view
					style="display: flex;justify-content: center;  align-items: center; flex-wrap: wrap; background-color: #FFF;margin-bottom: 1px;"
					v-if="this.obj.ContentVideos.length>0">

					<u-upload :fileList="fileList2" @afterRead="afterRead" @delete="deletePic" name="4" :maxCount="1"
						:maxSize="maxsize" @oversize="oversize" previewFullImage>
					</u-upload>
				</view>
			</view>

			<view class="contentClass">
				<view class="name">
					<view>职位描述</view>
				</view>
				<view class="" style="padding: 30rpx 0; background-color: #FFF;">
					<u--textarea v-model="obj.Content" :confirmType="null" placeholder="请输入内容" maxlength="3000"
						count></u--textarea>
				</view>
			</view>
			<u-picker :show="showJobState" :value="jobState" :defaultIndex="defaultIndex" closeOnClickOverlay
				@cancel="showJobState=false" @close="showJobState=false" keyName="FullName" :columns="jobStateList"
				@confirm="jobchange">
			</u-picker>
		</view>
		
		<addPopup :show.sync='addShow' v-if="addShow" :addTitle='addTitle' :addxxAddressItem='addxxAddressItem' @editAddress="editAddress"></addPopup>
	</view> -->

	<view>
		<myHead title="发布职位"></myHead>

		<view class="contentCla">
			<view class="box1Cla">
				<view class="titleCla">基本信息</view>
				<view class="zhuCla">注：职位名称、职位类别发布后不可修改~</view>
				<view class="leixingCla">工作类型</view>
				<view class="leixingconCla">
					<view class="leixingBtnCla" @click="gongzuoClick(0)" :class="{'leixingBtnCla1':obj.WorkType == 0}">
						全职
					</view>
					<view class="leixingBtnCla" @click="gongzuoClick(1)" :class="{'leixingBtnCla1':obj.WorkType == 1}">
						兼职
					</view>
					<view class="leixingBtnCla" @click="gongzuoClick(2)" :class="{'leixingBtnCla1':obj.WorkType == 2}">
						实习
					</view>
				</view>
				<view class="leixingCla">招聘类型</view>
				<view class="leixingconCla">
					<view class="leixingBtnCla" @click="zhaopinClick(0)" :class="{'leixingBtnCla1':obj.JobType == 0}">社招
					</view>
					<view class="leixingBtnCla" @click="zhaopinClick(1)" :class="{'leixingBtnCla1':obj.JobType == 1}">校招
					</view>
					<view class="leixingBtnCla" @click="zhaopinClick(2)" :class="{'leixingBtnCla1':obj.JobType == 2}">急聘
					</view>
				</view>
				<view class="leixingCla">职位名称</view>
				<view class="zhiweileibieCla" @click="miaoshuMingcgebfClick('mingcheng')">
					<view class="content2" v-if="obj.JobName">
						{{obj.JobName}}
					</view>
					<view class="content" v-else>
						请填写职位名称，如“销售专员”
					</view>
					<u-icon name="arrow-right"></u-icon>
				</view>
				<view class="leixingCla">职位类别</view>
				<view class="zhiweileibieCla" @click="miaoshuleibieClick('leibie')">
					<view class="content1" v-if="obj.PositionId">
						{{obj.PositionLab}}
					</view>
					<view class="content" v-else>
						{{'请选择职位类别，如“销售”'}}
					</view>
					<u-icon name="arrow-right"></u-icon>
				</view>
				<uni-data-picker v-if="colum" :localdata="colum" v-model="zwVal" class="unidatapickert"
					popup-title="请选择期望职位" ref="picker" @change="onchange">
				</uni-data-picker>
				<view class="leixingCla" v-if="obj.PositionId">职位关键词(选填)</view>
				<view class="zhiweileibieCla" v-if="obj.PositionId" @click="miaoshuClick('guanjianci')">
					<view class="content" v-if="obj.Tags.length <= 0">
						请选择职位关键词
					</view>
					<view class="content2" v-else>
						<text v-for="(item,index) in zhiweiguanjianciTags" :key="index">
							<span>{{item.FullName}}</span>
							<text style="margin: 0 20rpx;" v-if="index-zhiweiguanjianciTags.length+1 ">·</text>
						</text>
					</view>
					<u-icon name="arrow-right"></u-icon>
				</view>
				<view class="leixingCla">职位描述</view>
				<view class="zhiweileibieCla" @click="miaoshuClick('miaoshu')">
					<view class="content2" v-if="obj.Content">
						{{obj.Content}}
					</view>
					<view class="content" v-else>
						请填写职位描述
					</view>
					<u-icon name="arrow-right"></u-icon>

				</view>
				<view class="leixingCla">视频介绍(选填)</view>
				<view class="shipinBoxCla">
					<view @click="videoClick" class="videoCla">
						<u-upload :fileList="fileList1" accept="video" @afterRead="uploadAvatar"
							@delete="deletePicuploadAvatar" name="5" :maxCount="1" previewFullImage previewImage
							:maxSize="videomaxsize" @oversize="Videooversize">
							<view class="shipinCla" v-if="!obj.ContentVideos[0].VideoPath">
								<u-icon name="plus" color="#AAAAAA" size="28"></u-icon>
							</view>
						</u-upload>
					</view>
					<!-- <view class="videoCla" v-if="obj.ContentVideos[0].VideoPath">
						<u-upload :fileList="fileList2" accept="image" @afterRead="uploadAvatar"
							@delete="deletePicuploadAvatar" name="5" :maxCount="1" previewFullImage previewImage
							:maxSize="videomaxsize" @oversize="Videooversize">
							<view class="shipinCla">
								 
							</view>
						</u-upload>
					</view> -->
				</view>

			</view>

		</view>

		<view class="btnbox">
			<view class="btn" @click="xiayibuCla">
				<text class="textCla">下一步</text>
			</view>
		</view>

	</view>

</template>

<script>
	import myHead from "@/pages/component/baseHead.vue";
	import pickRegions from "@/pages/component/pick-regions2/pick-regions2.vue";
	import area from "@/pages/component/area.js";
	import addPopup from '@/pages/component/addPopup/index.vue';
	import {
		nextTick
	} from "vue";
	export default {
		data() {
			return {
				gongsiAddress: [], //地址
				gongsiAddressObj: [], // 地址全部信息
				gongsiAddressShow: false, //地址选择器
				areaOptions: area, //地址
				// defaultIndex:[0],  //选择器默认值
				URL: this.$config.domain.staticUrl,

				title: "基本信息",
				show2: false,
				showJobState: false,
				jobStateList: [],

				headImg: "", //图片访问地址
				f_cunchulujing: "", //存数据库的地址  如果空就不提交
				f_fangwenlujing: "",
				name: "", //姓名
				work: "", //工作时间
				jobState: "", //求职状态
				city: "",
				isSel: false, //是否是选择

				timestamp: "",

				// 当前id
				Id: 0,
				// 父id
				fuid: 0,
				key: 0,

				zhiweiKey: '',
				obj: {
					WorkType: null, //职位性质 0全职 1兼职 2实习
					JobType: null, // 招聘类型 0社招 1校招 2急聘
					JobName: null, //职位名称
					PositionLab: null, //职位类别
					PositionId: null, // 职位ID
					CategoryIds: null, //职位分类分类 多个逗号隔开 备用.
					Tags: [], // 职位关键词
					Content: "", // 职位描述
					ContentVideos: [
						// 职位视频
						{
							ImgPath: '', // 封面地址
							VideoPath: "", // 视频地址
						},
					],
					Id: 0,
					Amount: null, // 招聘人数

					CorpId: null, //职位所属企业id
					CorpName: null, // 职位所属企业名称
					Experience: null, // 工作经验
					Education: null, // 学历要求
					ProvinceCode: null, // 省
					CityCode: null, // 市
					AreaCode: null, // 区
					PcaAddress: null, // 省市区
					Address: '', // 工作地点 详细地址
					Longitude: 0, // 工作地点 经度
					Latitude: 0, // 工作地点 纬度
					ShortAddress: null, //简短地址

					Category1: null, // 职位分类1
					Category2: null, // 职位分类2
					Category3: null, // 职位分类3

					Negotiable: false, // 薪资待遇(可面议)
					// Wage: null, // 薪资待遇 参考字典 如 1-3
					AnualSalary: 0, //年度月薪
					MinWage: 0, // 薪资待遇 最低
					MaxWage: 0, // 薪资待遇 最高
					OfficeHours: null, // 上班时间
					Holiday: null, // 工作假期
					fbtype: 1, //1add  2编辑
				},
				keyNames: null,
				zwVal: "2",
				xzcustomize: false,
				MinWage: null, // 薪资待遇 最低
				MaxWage: null, // 薪资待遇 最高
				xzShow: false,
				sbcustomize: false,
				sbShow: false,
				jxcustomize: false,
				jxShow: false,
				popupShow: false,
				chooseIndex: [],
				wordArr: [],
				word: "", // 自定义关键字
				maxsize: "3145728", //图片大小限制
				videomaxsize: "314572800", //视频大小限制

				yixuan: 0,
				judgment: null,
				judgment1: null,
				zhiweidisabled: false,

				addShow: false,
				addTitle: '工作地址',
				addxxAddressItem: {},
				zhiweiguanjianciTagsArr: [],

				detail: null,
			};
		},
		//子组件
		components: {
			myHead,
			pickRegions,
			addPopup
		},
		computed: {
			colum() {
				if (this.$store.state.industry) {
					return this.subTree(this.$store.state.industry);
				} else {
					return "";
				}
			},
			zhiweiguanjianciTags() {
				this.zhiweiguanjianciTagsArr = []
				this.obj.Tags.forEach(item => {
					if (item.IsChecked) {
						this.zhiweiguanjianciTagsArr.push(item)
					}
				})
				return this.zhiweiguanjianciTagsArr
			},

			// PositionLab() {
			// 	let text = null;
			// 	this.$store.state.industry.forEach((ite1) => {
			// 		if (ite1.Id == this.obj.Category1) {
			// 			ite1.Children.forEach((ite2) => {
			// 				if (ite2.Id == this.obj.Category2) {
			// 					ite2.Children.forEach((ite3) => {
			// 						if (ite3.Id == this.obj.Category3) {
			// 							text = ite3.FullName;
			// 						}
			// 					});
			// 				}
			// 			});
			// 		}
			// 	});
			// 	return text;
			// },
			// // 上班时间是否自定义
			// sbjudgment() {
			// 	debugger;
			// 	if (this.obj.OfficeHours) {
			// 		let shows = true;
			// 		this.$store.state.hours.forEach((item) => {
			// 			if (item.FullName == this.obj.OfficeHours) {
			// 				shows = false;
			// 			}
			// 		});
			// 		this.sbcustomize = shows;
			// 	}
			// },

			// // 视频预览
			fileList1() {
				if (this.obj.ContentVideos.length > 0) {
					if (this.obj.ContentVideos[0].VideoPath) {
						return [{
							url: `${this.URL + this.obj.ContentVideos[0].VideoPath}`,
						}, ];
					}
				}
			},
			// fileList2() {
			// 	if (this.obj.ContentVideos.length > 0) {
			// 		if (this.obj.ContentVideos[0].ImgPath) {
			// 			// console.log(`${this.URL+this.obj.ContentVideos[0].ImgPath}`)
			// 			return [{
			// 				url: `${this.URL + this.obj.ContentVideos[0].ImgPath}`,
			// 			}, ];
			// 		}
			// 	}
			// },

			//编辑时地址选择器回显
			// defaultIndexAdd() {
			// 	let add = [];
			// 	if (this.obj.Address) {
			// 		this.gongsiAddressObj.map((item, index) => {
			// 			if (item.Address == this.obj.Address) {
			// 				add = [index];
			// 			}
			// 		});
			// 	}
			// 	return add;
			// },

			// //编辑时选择器的回显
			// defaultIndex() {
			// 	if (this.type == 2) {
			// 		let arr = this.jobStateList[0];
			// 		if (this.keyNames == "WorkType") {
			// 			return [this.obj.WorkType];
			// 		} else if (this.keyNames == "Experience") {
			// 			for (let i = 0; i < arr.length; i++) {
			// 				if (arr[i].EnCode == this.obj.Experience) {
			// 					return [i];
			// 				}
			// 			}
			// 		} else if (this.keyNames == "Education") {
			// 			for (let i = 0; i < arr.length; i++) {
			// 				if (arr[i].EnCode == this.obj.Education) {
			// 					return [i];
			// 				}
			// 			}
			// 		} else if (this.keyNames == "JobType") {
			// 			for (let i = 0; i < arr.length; i++) {
			// 				if (arr[i].EnCode == this.obj.JobType) {
			// 					return [i];
			// 				}
			// 			}
			// 		} else if (this.keyNames == "Wage") {
			// 			for (let i = 0; i < arr.length; i++) {
			// 				if (arr[i].EnCode == this.obj.Wage) {
			// 					return [i];
			// 				}
			// 			}
			// 			// arr.forEach((item, index) => {
			// 			// 	if(arr[index].EnCode == this.obj.Wage){
			// 			// 		return [index]
			// 			// 	}
			// 			// })
			// 		} else if (this.keyNames == "OfficeHours") {
			// 			for (let i = 0; i < arr.length; i++) {
			// 				if (arr[i].FullName == this.obj.OfficeHours) {
			// 					return [i];
			// 				}
			// 			}
			// 		} else if (this.keyNames == "Holiday") {
			// 			for (let i = 0; i < arr.length; i++) {
			// 				if (arr[i].FullName == this.obj.Holiday) {
			// 					return [i];
			// 				}
			// 			}
			// 		}
			// 	} else {
			// 		return [0];
			// 	}
			// },
			// xzda() {
			// 	let name = null;
			// 	if (!this.$store.state.salary) return;
			// 	this.$store.state.salary.forEach((ite) => {
			// 		if (ite.EnCode == String(this.obj.Wage)) {
			// 			name = ite.FullName;
			// 		}
			// 	});
			// 	if (name == null) {
			// 		this.xzcustomize = false;
			// 	}

			// 	return name ? name : this.obj.Wage;
			// },
		},

		watch: {
			"obj.PositionLab": {
				handler(newValue, oldValue) {
					console.log(newValue, oldValue, '监听-----------')
					if (newValue !== oldValue && oldValue !== null) {
						this.obj.Tags = [];
					}
				}
			}
		},

		onShow() {
			let date = new Date(); //Fri Oct 29 2021 16:37:56 GMT+0800 (CST)
			this.timestamp = new Date().getTime();
		},
		onLoad(o) {
			console.log(o.key, '---------------')
			this.detail = o.key == undefined ? null : JSON.parse(decodeURIComponent(o.key));
			let htis = this;
			if (this.detail !== null) {
				this.$http.huirc.jobDetails(this.detail).then((res) => {
					if (res.Success) {
						console.log(res, '返回数据---------')
						this.obj.fbtype = 2;
						this.obj.Id = res.Result.Id;
						this.obj.WorkType = res.Result.WorkType;
						this.obj.JobType = res.Result.JobType;
						this.obj.JobName = res.Result.JobName;
						this.obj.PositionId = res.Result.PositionId;
						//职位类别回显
						this.obj.CategoryIds = res.Result.CategoryIds.replace(/\s*/g, "")
						let arr = this.obj.CategoryIds.split(',')
						this.$store.state.industry.forEach(item => {
							if (item.Id == arr[0]) {
								item.Children.forEach(item1 => {
									if (item1.Id == arr[1]) {
										item1.Children.forEach(item2 => {
											if (item2.Id == arr[2]) {
												this.obj.PositionLab = item2.FullName;
											}
										})
									}
								})
							}
						})
						//职位关键词回显
						// let guanjianciarr = res.Result.Tags;
						// guanjianciarr.forEach(item => {
						// 	this.obj.Tags.push(item.FullName)
						// })
						this.obj.Tags = res.Result.Tags;



						this.obj.Amount = res.Result.Amount;
						// this.obj = {
						// 	... this.obj ,
						// 	...res.Result,
						// }
						// for(let key in htis.obj) {
						// 	// htis.obj[key] = res.Result[key]
						// 	this.$set(this.obj, key, res.Result[key]);
						// }

						// this.key += 1
						// this.$forceUpdate();

						this.obj.CorpId = res.Result.CorpId;
						this.obj.CorpName = res.Result.CorpName;
						if (
							res.Result.MinExperience !== null &&
							res.Result.MaxExperience !== null
						) {
							this.obj.Experience = `${
              res.Result.MinExperience + "-" + res.Result.MaxExperience
            }`;
						} else {
							if (res.Result.Experience == "在校生") {
								res.Result.Experience = "在校生";
							} else {
								res.Result.Experience = "应届生";
							}
						}
						// this.obj.Experience = `${res.Result.MinExperience + '-' + res.Result.MaxExperience}`
						// this.obj.Experience = res.Result.Experience
						this.obj.Education = res.Result.Education;
						this.obj.ProvinceCode = res.Result.ProvinceCode; //省
						this.obj.CityCode = res.Result.CityCode; //市
						this.obj.AreaCode = res.Result.AreaCode; //区
						// if(res.Result.PcaAddress == null){
						// 	this.areaOptions.forEach((item1,index) => {
						// 		if(item1.value == this.obj.ProvinceCode){
						// 			if(item1.label == '北京市' || item1.label == '天津市' || item1.label == '上海市' || item1.label == '重庆市'){
						// 				this.obj.PcaAddress = item1.label

						// 			} else{
						// 				let ProvinceCode1 = item1.label
						// 				item1.children.forEach((item2,index) => {
						// 					if(item2.value == res.Result.CityCode){
						// 						let CityCode1 = item2.label
						// 						this.obj.PcaAddress = ProvinceCode1 + CityCode1
						// 					}
						// 				})
						// 			}
						// 		}
						// 	})
						// }
						// this.obj.PcaAddress = res.Result.PcaAddress
						this.obj.Address = res.Result.Address;
						this.obj.Longitude = res.Result.Longitude;
						this.obj.Latitude = res.Result.Latitude;

						this.obj.Category1 = res.Result.Category1;
						this.obj.Category2 = res.Result.Category2;
						this.obj.Category3 = res.Result.Category3;

						// this.obj.Wage = res.Result.Wage;
						this.obj.MinWage = res.Result.MinWage;
						this.obj.MaxWage = res.Result.MaxWage;
						this.obj.AnualSalary = res.Result.AnualSalary;

						this.obj.OfficeHours = res.Result.OfficeHours;
						this.obj.Holiday = res.Result.Holiday;
						this.obj.Content = res.Result.Content;
						if (res.Result.ContentVideos.length > 0) {
							this.obj.ContentVideos[0].ImgPath =
								this.URL + "@/static/static/images/shipinfengmian.png"
							this.obj.ContentVideos[0].VideoPath =
								res.Result.ContentVideos[0].VideoPath;
						}
						// this.obj.Tags = res.Result.Tags;
						// console.log(this.obj.Tags);
						// this.obj.Tags.forEach((item, index) => {
						// 	(item.checked = true), (item.close1 = true);
						// });

						// this.yixuan = this.obj.Tags.length;
						// 修改进来后不可以修改职位名称
						this.zhiweidisabled = true;
					}
				});
			}

			if (this.obj.Longitude == 0 && this.obj.Latitude == 0) {
				let tabt = this;
				uni.getLocation({
					type: "wgs84",
					success: function(res) {
						tabt.obj.Longitude = res.longitude;
						tabt.obj.Latitude = res.latitude;
					},
				});
			}
		},
		created() {
			// this.jobLabelList()
			this.obj.CorpName = uni.getStorageSync("dianjiqiye").FullName;
			this.obj.CorpId = uni.getStorageSync("dianjiqiye").Id;
			this.getIndustry();
			if (this.obj.ContentVideos.length > 0) {
				this.obj.ContentVideos[0].ImgPath =
					this.URL + "@/static/static/images/shipinfengmian.png"
			}
			// 地址
			this.$http.core.tenantgetbasic(this.obj.CorpId).then((res) => {
				if (res.Success) {
					let list = res.Result.Address;
					this.gongsiAddressObj.push(...list);
					let arr = [];
					list.forEach((item) => {
						arr.push(item.Address);
					});
					this.gongsiAddress.push(arr);
				}
			});
		},
		// 计算方法
		methods: {
			//下一步点击事件
			xiayibuCla() {
				if (this.obj.WorkType == null) {
					this.$util.toast("请选择工作类型");
					return;
				}
				if (this.obj.JobType == null) {
					this.$util.toast("请选择招聘类型");
					return;
				}
				if (!this.obj.JobName) {
					this.$util.toast("请输入职位名称");
					return;
				}
				if (!this.obj.PositionId) {
					this.$util.toast("请选择职位类别");
					return;
				}
				if (!this.obj.Content) {
					this.$util.toast("请输入职位描述");
					return;
				}
				uni.navigateTo({
					url: '/pages/views/packageC/type-recruit/zhiwei/addindex2?data=' + JSON.stringify(this.obj)
				});
			},

			// 点击选择工作类型 
			gongzuoClick(val) {
				if (val == this.obj.WorkType) return;
				this.obj.WorkType = val;
			},

			// 点击选择招聘类型
			zhaopinClick(val) {
				if (val == this.obj.JobType) return;
				this.obj.JobType = val;
			},

			//职位类别点击事件
			zhiweileibieClick() {
				this.$refs.picker.show();
			},

			// 职位描述点击事件
			miaoshuClick(val) {

				let data = {}

				if (val == 'miaoshu') {
					data.ContentText = this.obj.Content;
					data.titleName = '职位描述';
					data.Content = '请勿填写QQ、微信、电话等联系方式及特殊符号、性别歧视词、违反劳动法相关内容，否则有可能导致您的账号被封禁。';
				} else if (val == 'guanjianci') {
					data.name = this.PositionLab;
					data.PositionId = this.obj.PositionId;
					data.Tags = this.obj.Tags;
					data.titleName = '岗位招聘关键词';
					data.Content = '您选择的职位关键词将用于为您推荐更合适的候选人';
				}

				data.title = val;
				this.zhiweiKey = val;

				uni.navigateTo({
					url: '/pages/views/packageC/type-recruit/zhiwei/zhiwei-page?data=' + JSON.stringify(data)
				})
			},

			miaoshuleibieClick(val) {
				let data = {};
				if (this.detail !== null) {
					this.$util.toast("职位类别不可修改！");
				} else {
					data.PositionLab = this.obj.PositionLab;
					data.titleName = '职位类别';
					data.Content = '您选择的职位类别将用于为您推荐更合适的候选人';
					data.title = val;
					this.zhiweiKey = val;
					uni.navigateTo({
						url: '/pages/views/packageC/type-recruit/zhiwei/zhiwei-page?data=' + JSON.stringify(data)
					})
				}
			},

			miaoshuMingcgebfClick(val) {
				let data = {};
				if (this.detail !== null) {
					this.$util.toast("职位名称不可修改！");
				} else {
					data.JobName = this.obj.JobName;
					data.titleName = '职位名称';
					data.Content = '不能填写QQ、微信、电话等联系方式，以及特殊符号';
					data.title = val;
					this.zhiweiKey = val;
					uni.navigateTo({
						url: '/pages/views/packageC/type-recruit/zhiwei/zhiwei-page?data=' + JSON.stringify(data)
					})
				}
			},

			getValue(val) {
				if (this.zhiweiKey == "miaoshu") {
					this.obj.Content = val;
				} else if (this.zhiweiKey == "mingcheng") {
					this.obj.JobName = val.FullName;
				} else if (this.zhiweiKey == "leibie") {
					console.log(val, '职位类别----------')
					this.obj.PositionLab = val.FullName;
					this.obj.PositionId = val.Id[2];
					this.obj.Category1 = val.Id[0];
					this.obj.Category2 = val.Id[1];
					this.obj.Category3 = val.Id[2];
					this.obj.CategoryIds = val.Id[0] + ',' + val.Id[1] + ',' + val.Id[2]
				}
			},

			guanjianci(val) {
				let arr = val;
				this.obj.Tags = [];
				this.obj.Tags = arr;
				// arr.forEach(item => {
				// 	if(){}
				// 	this.obj.Tags.push(item.FullName)
				// })
			},
			//职位类别回显
			huixian() {

			},






			//标签动态添加
			// DynamicAddition() {
			// 	if (this.yixuan < 9) {
			// 		if (this.word != "") {
			// 			let obj = {
			// 				FullName: this.word,
			// 				checked: true,
			// 				close1: true,
			// 				closable: true
			// 			};
			// 			this.obj.Tags.push(obj);
			// 			console.log(this.obj.Tags);
			// 			this.addShow = false;
			// 			this.word = "";
			// 			this.yixuan = this.yixuan + 1;
			// 		} else {
			// 			this.$util.toast("职位关键词不能为空！");
			// 		}
			// 	} else {
			// 		this.$util.toast("选择的职位关键词不能超过9个！");
			// 	}

			// },

			//职位标签多选
			// checkboxClick(ite, index) {
			// 	if (this.yixuan < 9) {
			// 		if (this.obj.Tags[index].closable == false) {
			// 			this.obj.Tags[index].checked = !this.obj.Tags[index].checked;
			// 			this.judgment = this.obj.Tags[index].checked;
			// 			this.judgment1 = this.obj.Tags[index].close1;

			// 			if (this.judgment == true && this.judgment1 == true) {
			// 				this.yixuan = this.yixuan + 1;
			// 			} else {
			// 				if (this.yixuan == 0) {
			// 					this.yixuan = this.yixuan
			// 				} else {
			// 					this.yixuan = this.yixuan - 1;
			// 				}

			// 			}
			// 		}

			// 	} else {
			// 		if (this.obj.Tags[index].checked == true && this.obj.Tags[index].closable == false) {
			// 			this.obj.Tags[index].checked = !this.obj.Tags[index].checked;
			// 			this.judgment = this.obj.Tags[index].checked;
			// 			this.judgment1 = this.obj.Tags[index].close1;

			// 			if (this.judgment == true && this.judgment1 == true) {
			// 				this.yixuan = this.yixuan + 1;
			// 			} else {
			// 				if (this.yixuan == 0) {
			// 					this.yixuan = this.yixuan
			// 				} else {
			// 					this.yixuan = this.yixuan - 1;
			// 				}

			// 			}
			// 		} else {
			// 			this.$util.toast("选择的职位关键词不能超过9个！");
			// 		}


			// 	}
			// },

			// shut(index) {
			// 	this.obj.Tags[index].close1 = false;
			// 	if (this.obj.Tags[index].checked == true) {
			// 		if (this.yixuan == 0) {
			// 			this.yixuan = this.yixuan
			// 		} else {
			// 			this.yixuan = this.yixuan - 1;
			// 		}

			// 	}
			// 	this.obj.Tags.splice(index, 1);
			// },

			// dropDown(val) {
			// 	this.keyNames = val;
			// 	if (val == "WorkType") {
			// 		this.jobStateList = [this.$store.state.leixing];
			// 		this.showJobState = true;
			// 	} else if (val == "Experience") {
			// 		this.jobStateList = [this.$store.state.jingyan];
			// 		this.showJobState = true;
			// 	} else if (val == "Education") {
			// 		this.jobStateList = [this.$store.state.xeuli];
			// 		this.showJobState = true;
			// 	} else if (val == "JobType") {
			// 		this.jobStateList = [this.$store.state.zhaopinlx];
			// 		this.showJobState = true;
			// 	} else if (val == "Wage") {
			// 		this.jobStateList = [this.$store.state.salary];
			// 		this.showJobState = true;
			// 	} else if (val == "OfficeHours") {
			// 		this.jobStateList = [this.$store.state.hours];
			// 		this.showJobState = true;
			// 	} else if (val == "Holiday") {
			// 		this.jobStateList = [this.$store.state.holiday];
			// 		this.showJobState = true;
			// 	}
			// },
			// jobchange(e) {
			// 	if (this.keyNames == "WorkType") {
			// 		this.obj[this.keyNames] = Number(e.value[0].EnCode);
			// 	} else if (this.keyNames == "Experience") {
			// 		this.obj[this.keyNames] = e.value[0].EnCode;
			// 	} else if (this.keyNames == "Education") {
			// 		this.obj[this.keyNames] = Number(e.value[0].EnCode);
			// 	} else if (this.keyNames == "JobType") {
			// 		this.obj[this.keyNames] = Number(e.value[0].EnCode);
			// 	} else if (this.keyNames == "Wage") {
			// 		this.obj[this.keyNames] = e.value[0].EnCode;
			// 	} else if (this.keyNames == "OfficeHours") {
			// 		this.obj[this.keyNames] = e.value[0].FullName;
			// 	} else if (this.keyNames == "Holiday") {
			// 		this.obj[this.keyNames] = e.value[0].FullName;
			// 	}

			// 	this.showJobState = false;
			// },

			getIndustry() {
				// let sa = {
				// 	FullName: "不限",
				// 	EnCode: null,
				// 	children: []
				// }
				// 薪资待遇
				this.$http.dic.DataSelector(385800457572485).then((res) => {
					if (res.Success) {
						this.$store.commit("setSalary", res.Result);
					}
				});
				// 学历要求
				this.$http.dic.DataSelector(385800548573317).then((res) => {
					if (res.Success) {
						this.$store.commit("setXeuli", res.Result);
					}
				});
				// 工作经验
				this.$http.dic.DataSelector(385800643113093).then((res) => {
					if (res.Success) {
						this.$store.commit("setJingyan", res.Result);
					}
				});
				// 行业
				this.$http.huirc.jobcategorytree().then((res) => {
					if (res.Success) {
						this.$store.commit("setIndustry", res.Result);
					}
				});
				// 求职状态
				this.$http.dic.DataSelector(390788264784005).then((res) => {
					if (res.Success) {
						this.$store.commit("setQiuzhi", res.Result);
					}
				});
				// 求职状态
				this.$http.dic.DataSelector(391109355008133).then((res) => {
					if (res.Success) {
						this.$store.commit("setNianling", res.Result);
					}
				});
				// 工作类型
				this.$http.dic.DataSelector(385801442541701).then((res) => {
					if (res.Success) {
						this.$store.commit("setLeixing", res.Result);
					}
				});
				// 招聘类型
				this.$http.dic.DataSelector(385801511669893).then((res) => {
					if (res.Success) {
						this.$store.commit("setZhaopinlx", res.Result);
					}
				});
				// 上班时间
				this.$http.dic.DataSelector(391177136312453).then((res) => {
					if (res.Success) {
						this.$store.commit("setHours", res.Result);
					}
				});
				// 工作假期
				this.$http.dic.DataSelector(391177702154373).then((res) => {
					if (res.Success) {
						this.$store.commit("setHoliday", res.Result);
					}
				});
			},
			subTree(arr, fatherArr) {
				let totalArr;
				if (fatherArr !== undefined) {
					totalArr = fatherArr.children;
				} else {
					totalArr = [];
				}
				arr.forEach((item, index) => {
					let obj = {};
					obj.text = item.FullName;
					obj.value = item.Id;
					obj.children = [];
					if (item.Children !== null && item.Children.length != 0) {
						this.subTree(item.Children, obj);
					}
					totalArr.push(obj);
				});
				return totalArr;
			},
			onchange(e) {
				// this.Category1 = e.detail.value[e.detail.value.length - 1].value
				this.obj.Category1 = e.detail.value[0].value;
				this.obj.Category2 = e.detail.value[1].value;
				this.obj.Category3 = e.detail.value[2].value;
				this.obj.CategoryIds =
					`${e.detail.value[0].value}, ${e.detail.value[1].value}, ${e.detail.value[2].value}`;
				this.obj.PositionId = e.detail.value[2].value;
				this.zwVal = e.detail.value[2].text;
				// this.jobLabelList();
				// this.arrData[this.inds].EnCode = OrgId
				// let Orgvalue = e.detail.value[e.detail.value.length - 1].text
				// this.arrData[this.inds].value = Orgvalue

				// if (e.detail.value.length == 3) {
				// 	this.Category1 = e.detail.value[0].value
				// 	this.Category2 = e.detail.value[1].value;
				// 	this.Category3 = e.detail.value[2].value;
				// }
				// if (e.detail.value.length == 2) {
				// 	this.Category1 = e.detail.value[0].value;
				// 	this.Category2 = e.detail.value[1].value;
				// }
				// if (e.detail.value.length == 1) {
				// 	this.Category1 = e.detail.value[0].value;
				// }
			},
			xialist(arr) {
				let drr = [];
				arr.forEach((res) => {
					let obj = {
						text: res.FullName,
						value: res.EnCode,
					};
					drr.push(obj);
				});
				return [drr];
			},

			gongsiAddressShowClick() {
				this.gongsiAddressShow = true;
			},
			//工作地址选择器
			addressOkClick(e) {
				this.gongsiAddressObj.forEach((item) => {
					if (e.value[0] == item.Address) {
						this.obj.ProvinceCode = item.ProvinceCode;
						this.obj.CityCode = item.CityCode;
						this.obj.AreaCode = item.AreaCode;
						this.obj.Latitude = item.Latitude;
						this.obj.Longitude = item.Longitude;
						this.obj.PcaAddress = item.PcaAddress;
					}
				});
				this.obj.Address = e.value[0];
				this.gongsiAddressShow = false;
			},

			Addresszidingyi() {
				// this.xxAddress();
				this.addShow = true;
				this.addxxAddressItem = {
					Latitude: this.obj.Latitude, //经度
					Longitude: this.obj.Longitude, //纬度
					Address: this.obj.Address, //详细地址
					PcaAddress: '', //区 街道 地址
					//省市区code值
					AreaCode: '',
					CityCode: '',
					ProvinceCode: '',
				}
			},

			//关闭地址弹窗
			editAddress(item) {
				this.addShow = false;
				this.obj = {
					...this.obj,
					...item
				};
			},

			// xxAddress() {
			// 	let that = this;
			// 	that.geocoderegeo();
			// 	uni.chooseLocation({
			// 		latitude: Number(that.obj.Latitude),
			// 		longitude: Number(that.obj.Longitude),
			// 		success: function(res) {
			// 			//经度
			// 			that.obj.Longitude = res.longitude;
			// 			//纬度
			// 			that.obj.Latitude = res.latitude;
			// 			that.obj.Address = res.address;
			// 			that.regeoAdd()
			// 		},
			// 		fail: function(e) {},
			// 	});

			// },

			// geocoderegeo() {
			// 	let latitude = this.obj.Latitude;
			// 	let longitude = this.obj.Longitude;
			// 	var location = null;
			// 	if (this.obj.Longitude !== 0 && this.obj.Latitude !== 0) {
			// 		location = longitude + "," + latitude;
			// 	} else {
			// 		uni.getLocation({
			// 			type: "wgs84",
			// 			success: function(res) {
			// 				let longitude1 = res.longitude;
			// 				let latitude1 = res.latitude;
			// 				location = longitude1 + "," + latitude1;
			// 			},
			// 		});
			// 	}

			// 	uni.request({
			// 		url: `https://restapi.amap.com/v3/geocode/regeo?key=ef98fef87aa9b2a353e8089128267ff0&location=${location}`, //逆地理编码接口地址。
			// 		method: "GET",
			// 		success: (res1) => {
			// 			//详细地址信息
			// 			//定位地址
			// 			//	_that.current_wz = res1.data.regeocode.formatted_address
			// 			let adcode = res1.data.regeocode.addressComponent.adcode;
			// 			area.forEach((item, index) => {
			// 				item.children?.forEach((item1, index) => {
			// 					item1.children?.forEach((item2, index) => {
			// 						if (adcode == item2.value) {
			// 							this.obj.ProvinceCode = item.value;
			// 							this.obj.CityCode = item1.value;
			// 							this.obj.AreaCode = item2.value;
			// 						}
			// 					});
			// 				});
			// 			});
			// 		},
			// 		fail(res) {
			// 			//	_that.$util.toast(res.errMsg)
			// 		},
			// 	});
			// },


			// handleGetRegion(e, item) { //获取到的数据
			// 	this.isSel = true;
			// 	console.log(e)
			// 	console.log(item);

			// 	// 省
			// 	this.obj.ProvinceCode = String(item[0].value)
			// 	// 市
			// 	this.obj.CityCode = String(item[1].value)
			// 	// 区
			// 	// this.obj.AreaCode = String(item[2].value)
			// 	// 省市区 空格隔开 如北京市 市辖区 西城区

			// 	if (e[0] == '北京市' || e[0] == "天津市" || e[0] == "上海市" || e[0] == "重庆市") {
			// 		this.obj.PcaAddress = e[0]
			// 	} else {
			// 		this.obj.PcaAddress = e.join(" ")
			// 	}
			// 	// console.log(this.obj.PcaAddress)
			// },
			open() {},
			// tagsChange(ite, index) {
			// console.log(ite,index,'qqqqqqqqqqqqqqqqqqqqqqqqqqqqq')
			// console.log(this.obj.Tags.findIndex(i => i.FullName == ite) != -1)
			// if (this.obj.Tags.findIndex(i => i.FullName == ite) != -1) {
			// 	this.obj.Tags.splice(this.obj.Tags.findIndex(i => i.FullName == ite), 1)
			// } else {
			// 	console.log(this.obj.Tags.length)
			// 	if (this.obj.Tags.length < 9) {
			// 		// this.chooseIndex.push(ite)
			// 		this.obj.Tags.push({
			// 			FullName: ite,
			// 		})
			// 	} else {
			// 		this.$util.toast("最多选择9个!")
			// 	}
			// }
			// console.log(this.obj.Tags)
			// },
			videoClick() {
				if (this.obj.ContentVideos[0].VideoPath) {
					let videoUrl = this.obj.ContentVideos[0].VideoPath;
					uni.navigateTo({
						url: "/pages/views/packageA/type-recruit/video/index?item=" +
							JSON.stringify(videoUrl),
					});
				}
			},
			//上传 视频
			uploadAvatar(file, lists, name) {
				let that = this;
				let tempFilePaths = file.file;
				uni.uploadFile({
					url: that.$config.domain.baseUrl + "/api/core/file/upload",
					filePath: tempFilePaths.url,
					name: "file",
					header: {
						Authorization: uni.getStorageSync("access_token").token_type +
							" " +
							uni.getStorageSync("access_token").access_token,
					},
					success: function(res) {
						if (res.statusCode == 200) {
							let data = JSON.parse(res.data);
							if (data.Success) {
								that.obj.ContentVideos[0].VideoPath = data.Result.Path;
							}
						}
					},
				});
			},
			// 删除视频
			deletePicuploadAvatar(file, lists, name) {
				console.log(file);
				this.obj.ContentVideos[0].VideoPath = "";
			},
			Videooversize(file, lists, name) {
				if (file.file.size > this.videomaxsize) {
					this.$util.toast("视频大小限制300M");
				}
			},

			// 上传 图片
			afterRead(file, lists, name) {
				var that = this;
				let tempFilePaths = file.file;
				let obj = {
					src: tempFilePaths.url,
				};
				that.$util.AuploadFile(obj).then((res) => {
					if (res.Success) {
						// that.src = res.Result.Path;
						// that.headImg.push(res.Result.Path);
						that.obj.ContentVideos[0].ImgPath = res.Result.Path;
					}
				});
			},
			// 删除图片
			deletePic(file, lists, name) {
				this.obj.ContentVideos[0].ImgPath = "";
			},
			// 图片大小超出限制
			oversize(file, lists, name) {
				if (file.file.size > this.maxsize) {
					this.$util.toast("图片大小限制3M");
				}
			},

			//上传头像
			// tpUploadAvatar() {
			// 	var that = this;
			// 	uni.chooseImage({
			// 		count: 1,
			// 		sizeType: ['original', 'compressed'],
			// 		success: (res) => {
			// 			const tempFilePaths = res.tempFilePaths //图片临时数组

			// 			uni.uploadFile({
			// 				url: this.$config.domain.baseUrl + "/api/core/file/upload",
			// 				filePath: tempFilePaths[0],
			// 				name: "",
			// 				header: {
			// 					'Authorization': uni.getStorageSync("access_token").token_type + " " +
			// 						uni.getStorageSync("access_token").access_token,
			// 				},
			// 				success: function(res) {
			// 					if (res.statusCode == 200) {
			// 						let data = JSON.parse(res.data)
			// 						if (data.Success) {
			// 							console.log(data.Result.Path)
			// 							console.log(data.Result)
			// 							that.headImg = data.Result.Path;
			// 						}

			// 					}

			// 				}
			// 			})
			// 		}

			// 	})
			// },
			xinziOKClick() {
				this.xzShow = true;
				if (!this.obj.Wage) {
					if (this.MinWage !== null && this.MaxWage !== null) {
						if (this.MinWage > this.MaxWage) {
							this.$util.toast("最高薪资不能低于最高薪资");
						} else {
							this.obj.Wage = `${this.MinWage + "-" + this.MaxWage}`;
						}
					}
				}
			},
			clickRight() {
				//校验
				if (!this.obj.WorkType) {
					if (this.obj.WorkType == 0) {} else {
						this.$util.toast("请选择工作类型");
						return;
					}
				}
				if (!this.obj.JobName) {
					this.$util.toast("请输入职位名称");
					return;
				}
				if (this.obj.Amount == '' && this.obj.Amount <= 0) {
					this.$util.toast("请输入招聘人数并且招聘的人数必须大于0");
					return;
				}

				if (!this.obj.Experience) {
					this.$util.toast("请选择工作经验");
					return;
				}
				if (!this.obj.Education) {
					this.$util.toast("请选择最高学历");
					return;
				}
				if (!this.obj.Address) {
					this.$util.toast("请选择工作地址");
					return;
				}
				if (!this.obj.JobType) {
					if (this.obj.JobType == 0) {} else {
						this.$util.toast("请选择招聘类型");
						return;
					}
				}
				if (!this.obj.PositionId) {
					if (this.obj.PositionId == 0) {} else {
						this.$util.toast("请选择职位类别");
						return;
					}
				}
				if (!this.obj.Wage) {
					this.$util.toast("请选择薪资待遇");
					return;
				}
				if (!this.obj.OfficeHours) {
					this.$util.toast("请选择上班时间");
					return;
				}
				if (!this.obj.Holiday) {
					this.$util.toast("请选择工作假期");
					return;
				}

				if (!this.obj.Content) {
					this.$util.toast("请输入职位描述");
					return;
				}

				// let arr = [];
				// this.obj.Tags.forEach((item, index) => {
				// 	if (item.checked == true) {
				// 		arr.push(item);
				// 	}
				// });
				// this.obj.Tags = arr;
				if (this.type == 2) {
					//编辑修改
					this.$http.huirc.jobModify(this.obj).then((res) => {
						if (res.Success) {
							this.$util.toast("修改成功");
							this.$store.commit("setUpData", (this.$store.state.upData += 1));
							setTimeout(() => {
								uni.navigateBack();
							}, 1000);
						}
					});
				} else {
					const app = getApp();
					let obj = {
						corpId: app.globalData.userCorpId, //企业ID
						searchType: 1, //状态
					};
					this.$http.plan.checkPlanFeature(obj).then((res) => {
						if (res.Success) {
							if (res.Result.IsEnabled) {
								this.$http.huirc.jobcr(this.obj).then((res) => {
									if (res.Success) {
										this.$util.toast("发布成功");
										this.$store.commit(
											"setUpData",
											(this.$store.state.upData += 1)
										);
										setTimeout(() => {
											uni.navigateBack();
										}, 1000);
									}
								});
							} else {
								this.$util.toast("会员权益点数已经消耗完，明天再来吧~~");
							}
						}
					});
				}
			},

			// 转换
			conversion(val, sta) {
				let name = null;
				// console.log(val,sta,String(val))
				if (!sta) return;
				sta.forEach((ite) => {
					if (ite.EnCode == String(val)) {
						name = ite.FullName;
					}
				});
				return name ? name : val;
			},

			// // 转换
			// xzda(val, sta) {
			// 	let name = null
			// 	// debugger
			// 	// console.log(val,sta,String(val))
			// 	if (!sta) return
			// 	sta.forEach(ite => {
			// 		if (ite.EnCode == String(val)) {
			// 			name = ite.FullName
			// 		}
			// 	})
			// 		console.log(name)
			// 	if(name == null){
			// 		console.log(1111111111)
			// 		this.$nextTick(() => {
			// 			this.xzcustomize = true
			// 		})
			// 	}
			// 	return name ? name : val
			// },

			confirm2(e) {
				// console.log(e)
				const timeFormat = uni.$u.timeFormat;
				let ds = timeFormat(e.value, "yyyy-mm-dd");
				this.work = ds;
				this.show2 = false;
			},
			checkout(type) {
				// console.log(value)
				if (type === "max") {
					if (this.MaxWage !== null && this.MaxWage !== "") {
						if (Number(this.MaxWage) <= Number(this.MinWage)) {
							// this.$util.toast("最高薪资高于最低薪资")
							this.$refs.uToast.show({
								type: "error",
								icon: false,
								message: "最高薪资高于最低薪资",
							});
						}
					}
				} else {
					if (this.MaxWage !== null && this.MaxWage !== "") {
						if (Number(this.MaxWage) <= Number(this.MinWage)) {
							// this.$util.toast("最高薪资高于最低薪资")
							this.$refs.uToast.show({
								type: "error",
								icon: false,
								message: "最高薪资高于最低薪资",
							});
						}
					}
				}
			},
			//职位关键词
			// jobLabelList() {
			// 	if (this.obj.PositionId) {
			// 		this.$http.huirc
			// 			.jobLabelList({
			// 				Id: this.obj.PositionId,
			// 			})
			// 			.then((res) => {
			// 				let obj = {};
			// 				if (res.Result.length > 0) {
			// 					res.Result.forEach((item) => {
			// 						obj.FullName = item.FullName;
			// 						obj.checked = true;
			// 						obj.close1 = true;
			// 						obj.closable = false;
			// 					});
			// 					this.obj.Tags.push(obj);
			// 				}

			// 				this.judgment = obj.checked;
			// 				this.judgment1 = obj.close1;
			// 				if (this.judgment == true && this.judgment1 == true) {
			// 					this.yixuan = this.yixuan + 1;
			// 				} else {
			// 					if (this.yixuan == 0) {
			// 						this.yixuan = this.yixuan;
			// 					} else {
			// 						this.yixuan = this.yixuan - 1;
			// 					}

			// 				}
			// 			});
			// 	}
			// },
		},
	};
</script>

<style lang="scss" scoped>
	// .conten {
	// 	// width: 100%;
	// 	// padding-top: 20rpx;

	// 	.unidatapickert {
	// 		position: fixed;
	// 		left: -5000px;
	// 		z-index: 99;
	// 	}
	// }

	// .li-box {
	// 	width: 100%;
	// 	padding: 40rpx 30rpx;
	// 	box-sizing: border-box;
	// 	background-color: #fff;
	// 	margin-bottom: 1px;

	// 	.name {
	// 		font-size: 30rpx;
	// 		font-family: PingFang SC;
	// 		font-weight: bold;
	// 		color: #000000;
	// 		flex-shrink: 0;
	// 		white-space: nowrap;
	// 		display: flex;
	// 		align-items: center;
	// 		justify-content: space-around;
	// 		// flex-direction: column;
	// 	}

	// 	.logo {
	// 		width: 106rpx;
	// 		height: 106rpx;
	// 		border-radius: 50%;
	// 	}

	// 	.input_pal {
	// 		text-align: end;
	// 	}

	// 	// input,
	// 	.content {
	// 		font-size: 30rpx;
	// 		font-family: PingFang SC;
	// 		font-weight: 500;
	// 		color: #999999;
	// 		text-align: justify;
	// 		margin-left: 40rpx;
	// 	}

	// 	.radio-box {
	// 		margin-left: 50rpx;

	// 		.radio-text {
	// 			font-size: 30rpx;
	// 			font-family: PingFang SC;
	// 			font-weight: 500;
	// 			color: #999999;
	// 			padding-left: 20rpx;
	// 		}
	// 	}
	// }

	// // /deep/.uni-input-placeholder{
	// // 	text-align: end !important;
	// // 	margin-left: 0 !important;
	// // }

	// .customized {
	// 	padding: 30rpx;
	// 	display: flex;
	// 	justify-content: center;

	// 	.lib1 {
	// 		display: flex;
	// 		margin-right: 28rpx;

	// 		// width: 184rpx;
	// 		// height: 60rpx;
	// 		#shangbanshijian {
	// 			/deep/ .uni-input-placeholder {
	// 				font-size: 26rpx !important;
	// 			}
	// 		}

	// 		.just {
	// 			display: flex;
	// 			align-items: center;
	// 			color: #c3c3c3;
	// 			margin: 0 20rpx;
	// 		}
	// 	}

	// 	.lib2 {
	// 		display: flex;
	// 	}
	// }

	// .popover {
	// 	height: 500rpx;
	// 	padding: 30rpx;

	// 	.popover-ul {
	// 		height: 380rpx;
	// 		overflow-y: auto;
	// 		display: flex;
	// 		flex-wrap: wrap;
	// 		// justify-content: space-around;
	// 		margin-bottom: 20rpx;
	// 		padding: 10rpx;

	// 		.popover-li {
	// 			width: 30%;
	// 			margin: 1.5%;
	// 			height: 60rpx;

	// 			// border-radius: 20rpx;
	// 			// border: 1px solid #ccc;
	// 			// margin-bottom: 10rpx;
	// 			// color: #999999;
	// 			// text-align: center;
	// 			// line-height: 60rpx;
	// 			/deep/.u-tag {
	// 				display: flex;
	// 				justify-content: center;
	// 			}

	// 			/deep/.u-tag__text {
	// 				white-space: nowrap;
	// 			}

	// 			/deep/ .u-tag-wrapper {
	// 				// display: flex;
	// 				// flex-direction: column;
	// 				// justify-content: end;
	// 				// height: 74rpx;
	// 				// width: 100%;
	// 				// margin-top: 20rpx;
	// 				// margin-right: 20rpx;

	// 			}

	// 			/deep/ .u-tag--medium {
	// 				margin-top: 0 !important;
	// 				margin-right: 0 !important;
	// 			}

	// 			/deep/ .u-tag__close {
	// 				top: 0 !important;
	// 				right: 0 !important;
	// 			}
	// 		}

	// 		.zxlybtn2 {
	// 			background: #3c9cff;
	// 			color: #fff;
	// 		}

	// 		// .popover-icon {
	// 		// 	width: 32%;
	// 		// 	display: flex;
	// 		// 	justify-content: center;
	// 		// }
	// 	}

	// 	.popover-bottom {
	// 		display: flex;
	// 		justify-content: space-between;

	// 		.bottom-left {
	// 			color: #999999;
	// 			display: flex;
	// 			align-items: center;
	// 		}

	// 		.bottom-right {
	// 			display: flex;

	// 			.u-button {
	// 				width: 150rpx;
	// 			}

	// 			.plus-circle {
	// 				margin-right: 40rpx;
	// 			}
	// 		}
	// 	}

	// 	/deep/.u-popup__content {
	// 		width: 90%;
	// 	}

	// 	.addClass {
	// 		height: 300rpx;
	// 		padding: 30rpx;

	// 		.addClass-top {
	// 			margin-bottom: 20rpx;

	// 			// display: flex;
	// 			.top-text {
	// 				display: flex;
	// 				font-size: 32rpx;
	// 				justify-content: center;
	// 				margin-bottom: 45rpx;
	// 			}

	// 			.top-input {
	// 				width: 614rpx;
	// 				margin-bottom: 45rpx;
	// 				border-radius: 10rpx;
	// 				border-left: 1rpx solid #c3c3c3;
	// 				border-right: 1rpx solid #c3c3c3;

	// 				.inputCla {
	// 					height: 80rpx;
	// 					border-radius: 10rpx;
	// 					border: 1rpx solid #c3c3c3;
	// 				}
	// 			}
	// 		}

	// 		.addClass-bottom {
	// 			display: flex;

	// 			// justify-content: space-around;
	// 			.u-button {
	// 				width: 150rpx;
	// 			}
	// 		}
	// 	}
	// }

	// .contentClass {
	// 	width: 100%;
	// 	padding: 40rpx 30rpx;
	// 	box-sizing: border-box;
	// 	background-color: #fff;
	// 	margin-bottom: 1px;

	// 	.name {
	// 		font-size: 30rpx;
	// 		font-family: PingFang SC;
	// 		font-weight: bold;
	// 		color: #000000;
	// 		flex-shrink: 0;
	// 		white-space: nowrap;
	// 		display: flex;
	// 		align-items: center;
	// 		// justify-content: space-around;
	// 		// flex-direction: column;
	// 	}
	// }


	.contentCla {
		display: flex;
		flex-direction: column;
		align-items: center;

		.box1Cla {
			background-color: #FFFFFF;
			border-radius: 20rpx;
			width: 85%;
			margin: 20rpx 0 220rpx;
			padding: 30rpx 30rpx;

			.titleCla {
				font-size: 32rpx;
				font-weight: bold;
				color: #000000;
			}

			.zhuCla {
				font-size: 24rpx;
				font-weight: 500;
				color: #333333;
				margin: 10rpx 0 50rpx;
			}

			.leixingCla {
				font-size: 26rpx;
				font-weight: 500;
				color: #333333;
				margin-bottom: 10rpx;
			}

			.leixingconCla {
				display: flex;
				margin-bottom: 38rpx;

				.leixingBtnCla {
					width: 168rpx;
					height: 52rpx;
					background: #F7F8FA;
					border-radius: 6rpx;
					font-size: 22rpx;
					font-weight: 400;
					color: #000000;
					display: flex;
					align-items: center;
					justify-content: center;
					margin-right: 20rpx;
				}

				.leixingBtnCla1 {
					width: 168rpx;
					height: 52rpx;
					background: #F1F8FF;
					border-radius: 6rpx;
					border: 1rpx solid #3476FE;
					color: #3476FE;
					font-size: 22rpx;
					font-weight: 400;
					display: flex;
					align-items: center;
					justify-content: center;
					margin-right: 20rpx;
				}
			}

			.zhiweiNameCla {
				margin-bottom: 30rpx;

				/deep/.u-input {
					padding: 12rpx 0 !important;
					font-size: 30rpx !important;
				}

				/deep/.uni-input-placeholder {
					color: #999999 !important;
				}

				/deep/.uni-input-input {
					font-weight: bold;
				}
			}

			.zhiweileibieCla {
				width: 100%;
				display: flex;
				justify-content: space-between;
				padding: 12rpx 0;
				border-bottom: 1rpx solid #dadbde;
				margin-bottom: 40rpx;

				.content {
					font-size: 30rpx;
					font-weight: 400;
					color: #999999;
				}

				.content1 {
					font-size: 30rpx;
					font-weight: bold;
					color: #000000;
				}

				.content2 {
					width: 90%;
					white-space: nowrap;
					overflow: hidden;
					text-overflow: ellipsis;
					font-size: 30rpx;
					font-weight: bold;
					color: #000000;
				}
			}

			.unidatapickert {
				position: fixed;
				left: -5000px;
				z-index: 99;
			}

			.shipinBoxCla {
				display: flex;

				.videoCla {
					margin-top: 20rpx;
					margin-right: 20rpx;

					/deep/.u-upload__wrap__preview__other {
						width: 168rpx;
						height: 168rpx;
						border-radius: 20rpx;
						background: url(/static/static/images/shipinfengmian.png) no-repeat center center;
						background-size: cover;
					}

					/deep/.uicon-movie {
						display: none !important;
					}

					/deep/.u-upload__wrap__preview__other__text[data-v-69e2a36e] {
						display: none;
					}

					.shipinCla {
						width: 168rpx;
						height: 168rpx;
						border-radius: 20rpx;
						opacity: 1;
						border: 1rpx solid #F0F0F0;
						display: flex;
						justify-content: center;
						align-items: center;
					}
				}
			}



		}

	}


	.btnbox {
		position: fixed;
		background-color: #fff;
		bottom: 0;
		width: 100%;
		height: 200rpx;
		text-align: center;

		.btn {
			background: #3476FE;
			border-radius: 10rpx;
			opacity: 1;
			height: 100rpx;
			line-height: 100rpx;
			text-align: center;
			margin: 30rpx 30rpx;
			box-sizing: border-box;

			.textCla {
				font-size: 30rpx;
				font-weight: bold;
				color: #FFFFFF;
			}
		}
	}
</style>